-- GENERATED SPELL FOR [Twilight Keeper Mayna] --


function spell0_15200(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(17165,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15200', 3000, 1)
end

function spell1_15200(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(22884,pUnit)
pUnit:RegisterEvent('Sorts_15200', 4302, 1)
end

function spell2_15200(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(15654,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15200', 18000, 1)
end

function Sorts_15200(pUnit, Event)
local choix_sorts_15200 = math.random(0, 2)
if choix_sorts_15200 == 0 then
pUnit:RegisterEvent('spell0_15200', 1, 1)
end
if choix_sorts_15200 == 1 then
pUnit:RegisterEvent('spell1_15200', 1, 1)
end
if choix_sorts_15200 == 2 then
pUnit:RegisterEvent('spell2_15200', 1, 1)
end
end

function mob15200_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15200', math.random(1500, 3000), 1)
end

function mob15200_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15200_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15200_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15200, 1, 'mob15200_Action')
RegisterUnitEvent(15200, 2, 'mob15200_Leave')
RegisterUnitEvent(15200, 3, 'mob15200_Kill')
RegisterUnitEvent(15200, 4, 'mob15200_Die')
